package com.gragra.sampling.sequentialStructure.tests;
import static org.junit.Assert.*;
import org.junit.Test;
import com.gragra.sampling.sequentialStructure.ExtensionLevels;
import com.gragra.sampling.sequentialStructure.PunctuationType;
/**
 * 
 * @author a2
 * 01.06.2013
 */
public class TestPunctuationType
{
	@Test
	public void testClassify()
	{
		String one = "sdfsfs.Asdfsad,asdafa.";
		String two = "...sdfsgasgafg..";
		String three = ";---)";
		String four = "Hammertime";
		assertEquals(PunctuationType.classify(one),PunctuationType.Mixed);
		assertEquals(PunctuationType.classify(two),PunctuationType.Mixed);
		assertEquals(PunctuationType.classify(three),PunctuationType.AllPunctuation);
		assertEquals(PunctuationType.classify(four),PunctuationType.NoPunctuation);
	}
	@Test
	public void testGetLevel()
	{
		for(PunctuationType pt : PunctuationType.values())
		{assertEquals(pt.getLevel(), ExtensionLevels.PunctuationLevel);}
	}
	@Test
	public void testGetNumber()
	{
		int num1 = PunctuationType.Mixed.getNumber();
		int num2 = PunctuationType.Mixed.getNumber();
		int num3 = PunctuationType.AllPunctuation.getNumber();
		assertEquals(num1,num2);
		assertFalse(num1 == num3);
		assertEquals(PunctuationType.values()[num1],PunctuationType.Mixed);
		assertEquals(PunctuationType.values()[num3],PunctuationType.AllPunctuation);
	}
}
